<?php

error_reporting(E_ALL ^ E_NOTICE);

require_once 'config2.php';
require_once 'ThemeFolderFixer.php';

foreach ($argv as $arg)
{

	if (preg_match("'^-f(.+)'", $arg, $matches))
	{
		$find = $matches[1];
	}
	if (preg_match("'^-r(.+)'", $arg, $matches))
	{
		$replace_with = $matches[1];
	}
}

$replace_with = str_ireplace('\\','/',$replace_with);
$importer = new ThemeFolderFixer($db_info);
$importer->fix($find,$replace_with);
//		$find='time_format';
//		$replace_with = 'eu';
//		$importer->fix($find,$replace_with);

/**
example config:

a:98:{
s:10:"is_site_on";s:1:"y";
s:15:"encryption_type";s:4:"sha1";
s:10:"site_index";s:9:"index.php";
s:8:"site_url";s:20:"http://coh_combined/";
s:16:"theme_folder_url";s:27:"http://coh_combined/themes/";
s:17:"theme_folder_path";s:27:"D:/coh_combined/dist/themes";
s:15:"webmaster_email";s:20:"tdallaway@ncsoft.com";
s:14:"webmaster_name";s:0:"";
s:19:"weblog_nomenclature";s:6:"weblog";
s:10:"max_caches";s:3:"150";
s:11:"captcha_url";s:38:"http://multisite_demo/images/captchas/";
s:12:"captcha_path";s:49:"C:/workspace/multisite_demo/dist/images/captchas/";
s:12:"captcha_font";s:1:"y";
s:12:"captcha_rand";s:1:"y";
s:23:"captcha_require_members";s:1:"n";
s:17:"enable_db_caching";s:1:"y";
s:18:"enable_sql_caching";s:1:"n";
s:18:"force_query_string";s:1:"n";
s:12:"show_queries";s:1:"n";
s:18:"template_debugging";s:1:"n";
s:15:"include_seconds";s:1:"n";
s:13:"cookie_domain";s:0:"";
s:11:"cookie_path";s:0:"";
s:13:"cookie_prefix";s:0:"";
s:17:"user_session_type";s:1:"c";
s:18:"admin_session_type";s:2:"cs";
s:21:"allow_username_change";s:1:"y";
s:18:"allow_multi_logins";s:1:"y";
s:16:"password_lockout";s:1:"y";
s:25:"password_lockout_interval";s:1:"1";
s:20:"require_ip_for_login";s:1:"y";
s:22:"require_ip_for_posting";s:1:"y";
s:18:"allow_multi_emails";s:1:"n";
s:24:"require_secure_passwords";s:1:"n";
s:19:"allow_dictionary_pw";s:1:"y";
s:23:"name_of_dictionary_file";s:0:"";
s:17:"xss_clean_uploads";s:1:"y";
s:15:"redirect_method";s:7:"refresh";
s:9:"deft_lang";s:7:"english";
s:8:"xml_lang";s:2:"en";
s:7:"charset";s:5:"utf-8";
s:12:"send_headers";s:1:"y";
s:11:"gzip_output";s:1:"n";
s:13:"log_referrers";s:1:"y";
s:13:"max_referrers";s:3:"500";
s:11:"time_format";s:2:"us";
s:15:"server_timezone";s:3:"UTC";
s:13:"server_offset";s:0:"";
s:16:"daylight_savings";s:1:"y";
s:21:"default_site_timezone";s:3:"UTC";
s:16:"default_site_dst";s:1:"y";
s:15:"honor_entry_dst";s:1:"y";
s:13:"mail_protocol";s:4:"mail";
s:11:"smtp_server";s:0:"";
s:13:"smtp_username";s:0:"";
s:13:"smtp_password";s:0:"";
s:11:"email_debug";s:1:"n";
s:13:"email_charset";s:5:"utf-8";
s:15:"email_batchmode";s:1:"n";
s:16:"email_batch_size";s:0:"";
s:11:"mail_format";s:5:"plain";
s:9:"word_wrap";s:1:"y";
s:22:"email_console_timelock";s:1:"5";
s:22:"log_email_console_msgs";s:1:"y";
s:8:"cp_theme";s:7:"default";
s:21:"email_module_captchas";s:1:"n";
s:16:"log_search_terms";s:1:"y";
s:12:"secure_forms";s:1:"y";
s:19:"deny_duplicate_data";s:1:"y";
s:24:"redirect_submitted_links";s:1:"n";
s:16:"enable_censoring";s:1:"n";
s:14:"censored_words";s:0:"";
s:18:"censor_replacement";s:0:"";
s:10:"banned_ips";s:0:"";
s:13:"banned_emails";s:0:"";
s:16:"banned_usernames";s:0:"";
s:19:"banned_screen_names";s:0:"";
s:10:"ban_action";s:8:"restrict";
s:11:"ban_message";s:34:"This site is currently unavailable";
s:15:"ban_destination";s:21:"http://www.yahoo.com/";
s:16:"enable_emoticons";s:1:"y";
s:13:"emoticon_path";s:37:"http://multisite_demo/images/smileys/";
s:19:"recount_batch_total";s:4:"1000";
s:13:"remap_pm_urls";s:1:"n";
s:13:"remap_pm_dest";s:0:"";
s:17:"new_version_check";s:1:"y";
s:20:"publish_tab_behavior";s:5:"hover";
s:18:"sites_tab_behavior";s:5:"hover";
s:17:"enable_throttling";s:1:"n";
s:17:"banish_masked_ips";s:1:"y";
s:14:"max_page_loads";s:2:"10";
s:13:"time_interval";s:1:"8";
s:12:"lockout_time";s:2:"30";
s:15:"banishment_type";s:7:"message";
s:14:"banishment_url";s:0:"";
s:18:"banishment_message";s:50:"You have exceeded the allowed page load frequency.";
s:17:"enable_search_log";s:1:"y";
s:19:"max_logged_searches";s:3:"500";}

*/
?>